<template>
  <div>
    <el-table
        :data="ListTbale"
        style="width: 100%" :header-cell-style="tableHeaderColor">
      <!--        <el-table-column-->
      <!--            prop="insureNo"-->
      <!--            label="保单号"-->
      <!--            align="center"-->
      <!--            width="180">-->
      <!--        </el-table-column>-->

      <el-table-column
          prop="id"
          align="center"
          label="消息编号"
          width="180">
      </el-table-column>
            <el-table-column
                prop="title"
                align="center"
                label="状态"
                width="180">
            </el-table-column>
      <el-table-column
          prop="reason"
          align="center"
          label="原因 / 结果">
      </el-table-column>
            <el-table-column
                prop="count"
                align="center"
                label="条数"
                width="180">
            </el-table-column>
      <el-table-column
          prop="update_time"
          align="center"
          label="创建时间">
      </el-table-column>
      <el-table-column
          align="center"
          label="操作">
        <template slot-scope="scope">
          <el-button style="color: #0095FF" type="text" size="small" @click="getDetails(scope.row)">查看详情</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
        style="background: transparent"
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
    />
  </div>
</template>

<script>
import {message_list} from "@/api/insurancemanagement/MessageNotification"
export default {
  name: "index",
  data(){
    return{
      queryParams: {
        user_id:'',//当前操作人
        pageNum: 1,
        // page:1,
        pageSize: 10,
        type: 1,//
        // 总条数
      },
      ListTbale:[],
      total:0
    }
  },
  methods:{
    /* 修改表头颜色 */
    tableHeaderColor({ rowIndex }) {
      if (rowIndex === 0) {
        return 'background-color: #304156;color: #fff;font-weight: 400;font-family: Microsoft YaHei;'
      }
    },
    //查看详情
    getDetails(item) {
     // console.log('item',item)
      if(item.href==1 || item.href==2){
        this.$router.push({
          path: '/business/user/index',
          // query:{
            // userInfo:item
          // }
        })
      }
      if(item.href==3){
        this.$router.push({
          path: '/policyHolder1',
          // query:{
          // userInfo:item
          // }
        })
      }

    },
    getList(){
      message_list(this.queryParams).then(res=>{
        this.ListTbale=res.data.list;
        this.total=res.data.count;
        // console.log('人员res',res)
      })
    }
  },
  created() {
    this.queryParams.user_id = JSON.parse(localStorage.getItem('userInfo')).userId;
    this.getList();
  }
}
</script>

<style scoped>

</style>
